Pos

Syntax: @Pos substring, source, result

The Pos command finds a string in another string.

Both the substring and the source string can be string literals, string arrays, list attributes or string variables. The result can be a numeric array, numeric variable or a numeric attribute.

If the operation is successful, the value of result will equal the numeric location of the FIRST character of the first match of the substring within the source string. If no match is found then the result value will be 0.

Note that the scan is case sensitive. The Upcase command can be used to convert strings to all upper case if required.

Examples

@Assign str[1] = 'Hello World'

@Pos 'orl', str[1], num[1,1]

num[1,1] would be equal to 8

@Pos 'v', str[1], num[1,1]

num[1,1] would be equal to 0